package com.johnguo.beam_test.read.consumer;

import java.util.Map;

import org.apache.beam.sdk.transforms.SerializableFunction;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.KafkaConsumer;

public class ConsumerFactoryFn implements SerializableFunction<Map<String, Object>, Consumer<byte[], byte[]>> {

	private static final long serialVersionUID = 1L;

	@Override
	public Consumer<byte[], byte[]> apply(Map<String, Object> input) {
		KafkaConsumer<byte[], byte[]> consumer = new KafkaConsumer<>(input);
		return consumer;
	}

}
